package com.fzh.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.fzh.pojo.entity.User;

public interface UserMapper {
	
	/**
	 * 鍚庡彴鐨勭櫥褰曢獙璇�
	 * @param user
	 * @return
	 */
	public User backLogin(@Param("name")String name,@Param("password")String password);
	
	/**
	 * 鏌ヨ鍑烘墍鏈夌殑鐢ㄦ埛淇℃伅
	 * @return
	 */
	public List<User> selectAllUser(@Param("setValue")int setValue,@Param("limit")int limit,@Param("name")String name,@Param("gender")String gender,@Param("isAdmin") String isAdmin);
	/**
	 * 鏌ヨ鍑簎ser琛ㄩ噷鐨勬�绘潯鏁�
	 * @return
	 */
	public int selectUserCounts(@Param("name")String name,@Param("gender")String gender,@Param("isAdmin")String isAdmin);
	/**
	 * 娣诲姞涓�涓敤鎴�
	 * @param user
	 * @return
	 */
	public int insertUser(User user);
	/**
	 * 鏍规嵁id淇敼涓�涓敤鎴�
	 * @param user
	 * @return
	 */
	public int updateUserById(User user);
	/**
	 * 鏍规嵁ids鎵归噺鐨勫垹闄ょ敤鎴�
	 * @param ids
	 * @return
	 */
	public int deleteAllUserByIds(List<String> ids);
	/**
	 * 鏍规嵁id鍒犻櫎涓�涓敤鎴�
	 * @param id
	 * @return
	 */
	public int deleteUserById(int id);
	/**
	 * 鐢ㄦ埛鐧诲綍鏃舵洿鏀规渶鍚庣殑鐧诲綍鏃堕棿
	 * @param date
	 * @param id
	 */
	public void updateUserLastLoginTimeById(@Param("date")String date, @Param("id")Integer id);
	
	/**
	 * 鏌ヨ鐧诲綍鏃惰緭鍏ョ殑鐢ㄦ埛鍚嶆槸鍚﹀瓨鍦�
	 * @param name
	 * @return
	 */
	public User selectUserByNameVerifyError(@Param("name")String name);

	/**
	 * 淇敼鐢ㄦ埛鐨勬槸鍚﹂攣瀹氳处鍙风姸鎬�
	 * @param id
	 * @param number
	 * @return
	 */
	public Integer updateUserIsLockById(@Param("id")Integer id, @Param("number")Integer number);

	/**
	 * 淇敼鐢ㄦ埛璐︽埛鏄惁鎴愪负绠＄悊鍛樼殑鐘舵��
	 * @param id
	 * @param number
	 * @return
	 */
	public Integer updateUserAdminStatusById(@Param("id")Integer id, @Param("number")Integer number);

	/**
	 * 鏌ヨ鍑烘墍鏈夌殑鐢ㄦ埛淇℃伅鐢ㄤ簬鍦ㄨ鍗曢〉涓嬫媺妗嗗睍绀�
	 * @return
	 */
	public List<User> selectAllUserWitchOrderIndoSelect();

	/**
	 * 淇敼绠＄悊鍛樼殑閿欒娆℃暟鏍规嵁id
	 * @param id
	 * @param errorCount
	 */
	public void updateUserErrorCountById(@Param("id")Integer id, @Param("errorCount")int errorCount, @Param("datestr")String datestr);

	/**
	 * 鍦ㄤ釜浜轰俊鎭〉缂栬緫鍩虹鐨勭櫥褰曡�呯敤鎴蜂俊鎭�
	 * @param user
	 * @return
	 */
	public Integer updateUserBasicInformationById(User user);

	/**
	 * 鏌ヨ鍑烘墍鏈夌敤鎴风殑淇℃伅鏍规嵁name鏉ユ煡璇㈠鏌ヨ鍑烘湁鑰呯粰鎻愮ず淇℃伅鐢ㄦ埛鍚嶄笉鑳介噸澶�
	 * @param newName
	 * @return
	 */
	public List<User> selectAllUserByNameWitchVerify(@Param("name")String newName);

	/**
	 * {鍓嶅彴}鐧诲綍楠岃瘉
	 * @param name
	 * @param password
	 * @return
	 */
	public User frontLogin(@Param("name")String name, @Param("password")String password);
	
	public User selectByuserId(Integer id);
	
	/**
	 * {前台}查看对应密码的用户
	 * @param id
	 * @param password
	 * @return
	 */
	public User selectLogins(@Param("id")Integer id, @Param("password")String password);
	
	/**
	 * 修改用户密码
	 * @param id
	 * @param password
	 * @return
	 */
	public Integer updatePassWord(@Param("id")Integer id, @Param("password")String password);
	
}
